﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ClientTab : MonoBehaviour {
    private Dropdown dpd;
    private void Awake()
    {
        dpd = GetComponent<Dropdown>();
    }
    // Use this for initialization
    void Start () {
        MCNetSocket.conns.OnClientChanges += FreshItems;
        dpd.onValueChanged.AddListener(ChangeSelect);

	}
	
	void FreshItems()
    {
        dpd.ClearOptions();
        dpd.AddOptions(new List<string>(MCNetSocket.conns.GetNameList()));
    }

    void ChangeSelect(int index)
    {
        MCNetSocket.instance.selectShower= index;

    }



}
